<?php (!defined('IN_SYSTEM') || !defined('ADMIN_PRE')) && exit('Access Denied!');?>
{admintemplate header}
<div class="box">
	<div class="heading">
	<h1>链接列表</h1>
	<div class="buttons">
	<a href="{url admin.php?m=link&f=add}" >添加链接</a>
	<a href="{url admin.php?m=link}" >所有链接</a>
	<a href="{url admin.php?m=category&r=link}" >链接分类</a>
	</div>
	</div>
	<div class="main">

		<div class="search">
			<form name="search" method="get" action="admin.php">
			<input type="hidden" name="m" value="link" />
			<input type="hidden" name="f" value="index" />
				<fieldset>
					<legend>链接查找</legend>
						关键字：
						<input type="text" name="keyword" size="15" value="<?=urldecode($keyword)?>" />
						<input type="submit" name="s" class="button" value="开始查找" />
						<input type="button" class="button" value="显示所有" onclick="window.location.href='admin.php?m=link&f=index'" />
						<input type="button" class="button" value="添加连接" onclick="window.location.href='admin.php?m=link&f=add'" />
				</fieldset>
			</form>
		</div>

		<form name="update" method="post" action="?m=link">
		<input type="hidden" id="f" name="f" />
			<table cellspacing="0" class="list" id="list">
			<thead>
				<tr>
					<td width="1" class="center">
					<td width="150"  class="left">名称</td>
					<td>链接</td>
					<td>跳转到</td>
					<td width="100">分类</td>
					<td width="80">可见</td>
					<td width="80">排序</td>
					<td width="80">点击</td>
					<td width="80">操作</td>
				</tr>
				</thead>
				<?foreach ($result as $row) {?>
				<tr id="row_<?=$row['lid']?>">
					<td class="center"><input type="checkbox" name="id[]" value="<?=$row['lid']?>" class="checkbox" /></td>
					<td><a href="?m=link&f=edit&id=<?=$row['lid']?>"><?=$row['title']?></a></td>
					<td>
					{if stripos($row['url'],'http')===false}
					<a href="go/{$row['url']}" target="_blank"><?=$row['url']?> </a>&nbsp;[<span onclick="setCopy('{BASE_URL}go/{$row[url]}')">复制</span>]
					{else}<a href="<?=$row['url']?>" target="_blank"><?=$row['url']?></a>{/if}</td>
					<td><a href="<?=$row['rssurl']?>" target="_blank"><?=$row['rssurl']?></a></td>
					<td align="center"><a href="?m=link&cid=<?=$row['cid']?>"><?=$row['catename']?></a></td>
					<td align="center"><?=$row['visible'] ? '<a href="?m=link&visible=yes" class="suc">是</a>' : '<a href="?m=link&visible=no" class="err">否</a>'?></td>
					<td align="center"><input type="text" name="listorder[<?=$row['lid']?>]" value="<?=$row['listorder']?>" size="5" class="input" /></td>
					<td>{$row['views']}</td>
					<td align="center"><a href="?m=link&f=edit&id=<?=$row['lid']?>">编辑</a></td>
				</tr>
				<?}?>
				<tr>
					<td class="center"><input type="checkbox" class="checkbox" value="1" name="chkall" onclick="check_all(this)" /></td>
					<td colspan="8"><?=pager($num,$pagesize,$page,$url)?>全选 
					<input type="radio" name="f" value="resort" id="resort" class="radio" checked="checked" onclick="$('#span_move').hide()" /><label for="resort">排序</label> 
					<input type="radio" name="f" value="delete" id="delete" class="radio" onclick="$('#span_move').hide()" /><label for="delete">删除</label> 
					<input type="radio" name="f" value="move" id="move" class="radio" onclick="$('#span_move').show()" /><label for="move">移动到</label>
					<span id="span_move" style="display:none">
					<select name="cid">
						<option value="">请选择</option>
						<?=get_category_options(null,1)?>
					</select>
					</span>
					<input type="submit" class="button" value="执行操作"/></td>
				</tr>
			</table>
		</form>
	</div>
</div>
<?php include(ADMIN_ROOT.'template/footer.tpl.php');?>